Repository navigation
fix(id): refuse duplicate after hashes in artifact check() (#3196) - #4318
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 19 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7a730f6c0a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| #[test] | ||
| fn duplicate_after_hashes_are_refused() { |
There was a problem hiding this comment.
Prefix the new test name with
test_
The scoped naming guideline in pkgs/id/AGENTS.md explicitly requires tests to use the test_ prefix. Rename this new test to test_duplicate_after_hashes_are_refused to follow the package’s documented convention.
AGENTS.md reference: pkgs/id/AGENTS.md:L140-L140
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in aed045e: renamed the test to test_duplicate_after_hashes_are_refused, per the test_ prefix convention in pkgs/id/AGENTS.md (L140). One-line rename, no logic change. — repo-worker-code, queue task 5661
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Fixes #3196
Queue task: task 5661
Problem
SignedArtifact::check()(pkgs/id/src/artifact.rs) cappedafterat MAX_AFTER and required every entry to be a hash, but never checked uniqueness — the same hash repeated 32 times filled the whole frontier and verified + inserted as New. The siblingChainExt::validate()(chain.rs) refuses the identical field withChainError::DuplicateAfter.Change
check()now runs a HashSet overafter(mirroring chain.rs) and refuses on the first repeat, with the error naming the repeated hash: "an artifact names {hash} twice in after".verify()andArtifactLog::insert; locally signed artifacts with a repeatedafterhash are refused at the same gate on insert.Tests
New test
duplicate_after_hashes_are_refusedin the artifact test module:verify()andinsert()Stored::NewVerification is GitHub Actions CI (id workflow) per the task packet — the laptop had no build window this shift (load ~100).
rustfmt --checkandgit diff --checkpass on the changed file.Need help on this PR? Tag
@codesmith-botwith what you need.